#ifndef _COS_EPOLL_H
#define _COS_EPOLL_H
#include "../common/type.h"
#include "../common/log.h"
class Session;
class SessionMgr;

class CEpoll
{
public:
	CEpoll();
	~CEpoll();
	void Init(u16int Port, u32int MaxConnections, SessionMgr * SessMgr, CLog * Log);
	bool Startup();
	void Shutdown();
	void MainLoop();
	void Accept();
	

private:
	bool AddToEpoll(int fd, u32int event);
	void ReadData(Session * pSess);
private:
	int m_Epoll;
	int m_ListenFd;
	u16int m_Port;
	u32int m_MaxConnections;
	bool m_IsWorking;
	SessionMgr * m_SessionMgr;
	CLog * m_Log;
};

#endif
